package com.xiangban.service.fallback;

import com.xiangban.model.res.ApiResult;
import com.xiangban.service.fegin.XiangBanMallServiceFeign;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import java.util.Map;

@Component
@Slf4j
public class XiangbanMallServiceFallback implements FallbackFactory<XiangBanMallServiceFeign> {
    @Override
    public XiangBanMallServiceFeign create(Throwable throwable) {
        return new XiangBanMallServiceFeign() {
            @Override
            public ApiResult<Object> updateUserOpenId(Map<String,Object> parameter) {
                log.info("XiangBanMall系统异常");
                return ApiResult.newError("openId更新失败");
            }
        };
    }
}
